home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacWorld 1999 January - Disc 2
/
Macworld (1999-01) (Disk 2).dmg
/
Serious Demos
/
Symbolic Composer 4.2
/
Environment
/
Projects
/
Examples
/
More Examples
/
Using frequency tunings
< prev
next >
Wrap
Text File
|
1998-10-26
|
3KB
|
88 lines
; How to play frequencies (200hz 330 hz 800hz 960hz 2000hz)?
Tuning scales are defined by standard way by ratios that describe the frequency
relations.
(create-tonality freq-tuning '(1/1 30/29 15/14 10/9 4/3 3/2 45/29 45/28 5/3))
To apply this to arbitrary frequencies you can write them as ratios so that
each frequency is devided by the first frequency in the series. This creates
a relational tuning scale and then plays it starting from g# 3. NOTE: you
must set up the starting position so that it reflecting your synthesizer
master tuning. You must also know how many steps between a semitone your
synthesizer can reproduce, here a value 4024 steps is used.
(create-tonality freq-tuning '(200/200 330/200 800/200 960/200 2000/200))
(def-section sect-a
default
zone '(2/1)
tonality (activate-tonality (freq-tuning g# 3 4024))
length '(1/8)
velocity '(64)
piano
symbol '(a b c d e)
)
(def-tempo 120)
(midiport :printer)
(play-file-p "tunings"
piano '(sect-a)
)
If you do not know how your synth reproduces tunings the easiest way
is to use approximations within the 12-tone scale. In the following you
define the frequencies with frequency-map. You must also define here the
starting point of the note that this frequency series is realized, here
(g# 3).
(def-section sect-a
default
zone '(2/1)
tonality (activate-tonality (frequency-map '(200/200 330/200 800/200 960/200 2000/200) 1 '(g# 3)))
length '(1/8)
velocity '(64)
piano
symbol '(a b c d e)
)
(def-tempo 120)
(midiport :printer)
(play-file-p "tunings"
piano '(sect-a)
)
What comes to realizing the frequencies exactly starting from 200 hz ... I would
say it is a bit difficult to achieve in MIDI because it is not designed to
operate on that precision.
I remember that low e on electric bass guitar produces about 40 hz tone. You
can tweak the equation by adjusting the number in the times operation below.
The frequencies are based on c 0 which produces 1 hz.
(* 16 (note-to-freq 'e 1))
--> 40.31747359663594
If the above value is ok then g# 3 will produce the most near value to 200
hz. In any case you'll never get exact frequencies in MIDI, but the results
always reflect the frequency relations - which is more important since
the hearing mechanism perceives relations.
(* 16 (note-to-freq 'g# 3))
--> 203.18733465192952
There is also a pair, freq-to-note.
(freq-to-note 200)
--> (g# 7)
Note that freq-to-note is based so that (freq-to-note 1) produces (c 0).